-
Notifications
You must be signed in to change notification settings - Fork 30
Conversation
lastuser_oauth/views/login.py
Outdated
@@ -172,6 +172,8 @@ def reset(): | |||
# User wants to reset password | |||
# Ask for username or email, verify it, and send a reset code | |||
form = PasswordResetRequestForm() | |||
if not (current_app.config.get('RECAPTCHA_PUBLIC_KEY') and current_app.config.get('RECAPTCHA_PRIVATE_KEY')): | |||
del form.recaptcha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that the recaptcha field name is recaptcha
. I'll push an update to remove any recaptcha field instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine because the field is defined in the same repo. However, this will need to be done in all forms that use the Recaptcha field, so do this instead:
Subclass Form into RecaptchaForm and add the field. Forms that need it can inherit from it. The position of the field in the form is no longer relevant when it's invisible. In the __init__
constructor, remove the field if the config values are not present. This can be done in a new file named lastuser_oauth/forms/recaptcha.py
.
lastuser_ui/forms/profile.py
Outdated
@@ -1,5 +1,6 @@ | |||
# -*- coding: utf-8 -*- | |||
|
|||
from flask_wtf import RecaptchaField |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this field to Baseframe. We shouldn't be importing anything from flask_wtf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a bunch of single comments instead of review comments.
Fixes #191 and #199.